package ui;

import tree.LeafCmd;
import h2d.Flow;
import ui.UICompents;

@:uiComp("view_town")
class Flow_Town extends Flow implements h2d.domkit.Object {
    static var SRC = 
	<view_town layout="horizontal">		
		<flow class="left" layout="vertical">
			<button("出城") class="left" public id = "btn_out"/>
			<button("道具店") class="left"/>
			<button("酒馆") class="left"/>
		</flow>
			<bitmap/>
		<flow class="right" layout="vertical">
			<button("教堂") class="right"/>
			<button("铁匠铺") class="right"/>
			<button("小巷") class="right"/>
		</flow>
	</view_town>
    
    public function new(?parent) {
		super(parent);
		initComponent();
		
	}
}

class View_Town extends ViewTress<Flow_Town> {
    public function new() {
        super(Flow_Town);
		m_style = new h2d.domkit.Style();
		m_style.load(hxd.Res.css.view_town);
		
    }

	override function OnUpdate(cmd:LeafCmd) {
		super.OnUpdate(cmd);
		
		m_view.btn_out.move(1, 1);
		m_view.btn_out.reflow();
		// m_view.btn_out.move()
		trace(m_view.btn_out.y);
	}
}